package com.ggs.rg.ybjb.pojomodule.pojo;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 
 * </p>
 *
 * @author cxw
 * @since 2021-11-23
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="TAddress对象", description="地址对象")
public class TAddress implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键，自增，唯一值")
    @TableId(value = "aid", type = IdType.AUTO)
    private Integer aid;

    @ApiModelProperty(value = "用户收货地址")
    private String address;

    @ApiModelProperty(value = "关联用户，外键约束")
    private String phone;

    @ApiModelProperty(value = "收货人姓名")
    private String consigneeName;

    @ApiModelProperty(value = "收货人手机号")
    private String consigneePhone;

    @ApiModelProperty(value = "数据生成时自动创建时自动")
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    @ApiModelProperty(value = "数据生成时自动生成，修改时自动更新")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    @ApiModelProperty(value = "乐观锁")
    @Version
    private Integer version;

    public TAddress(String address, String phone, String consigneeName, String consigneePhone) {
        this.address = address;
        this.phone = phone;
        this.consigneeName = consigneeName;
        this.consigneePhone = consigneePhone;
    }

    public TAddress(Integer aid, String address, String consigneeName, String consigneePhone) {
        this.aid = aid;
        this.address = address;
        this.consigneeName = consigneeName;
        this.consigneePhone = consigneePhone;
    }
}
